package com.zhang.zhangapp.view.custom;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.zhang.zhangapp.R;

import java.util.List;

/**
 * Created by 罗肖 on 2018/4/10.
 */

public class SearchItemView extends LinearLayout {

    private List<String> searchStringList;

    public SearchItemView(Context context, List<String> list) {
        super(context);
        this.searchStringList = list;
        LayoutInflater.from(context).inflate(R.layout.search_item_layout, this);
        TextView textView1 = (TextView) findViewById(R.id.search_item_text1);
        TextView textView2 = (TextView) findViewById(R.id.search_item_text2);
        TextView textView3 = (TextView) findViewById(R.id.search_item_text3);

        textView1.setText(list.get(0));
        if (list.size() > 1)
            textView2.setText(list.get(1));
        if (list.size() > 2)
            textView3.setText(list.get(2));
    }
}
